package com.prik.command.commands;

import com.prik.command.Command;
import com.prik.command.products.Stereo;

/**
 * 音响打开命令
 **/
public class StereoOffWithCdCommand implements Command {

    Stereo stereo;

    public StereoOffWithCdCommand(Stereo stereo) {
        this.stereo = stereo;
    }

    @Override
    public void execute() {
        stereo.off();
    }

    @Override
    public void undo() {
        stereo.on();
        stereo.playCD();
        stereo.setVolume(50);
    }
}